package com.atguigu.spzx.manager.controller;


import com.atguigu.spzx.model.dto.system.SysUserDto;

import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.model.vo.common.ResultCodeEnum;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/zxw/admin/system/sysUser")
@Slf4j
public class AaaaaaTestControllerZxw {


    @GetMapping("/test001")
    public Result test001() {
        System.out.println("success");
        System.out.println("\033[33m"+"执行成功"+"\033[m");//中间的字符串打印出来将是红色
        System.out.print("\33[45;1m"+"执行成功"+"\n\33[0m");
        return Result.build("success", ResultCodeEnum.SUCCESS);
    }

    @GetMapping("/test002")
    public Result test002(@RequestBody SysUserDto sysUserDto ,@PathVariable(value = "pageSize") Integer pageSize, @PathVariable(value = "pageNum") Integer pageNum) {


        return Result.build(null, ResultCodeEnum.SUCCESS);
    }
    @GetMapping("/test003")
    public Result test003() {
        log.info("\033[31m"+"从这里开始-开发新的功能"+"\033[m");
        System.out.println("从这里开始-开发新的功能");
        System.out.println("\033[31m"+"31是红色"+"\033[m");//中间的字符串打印出来将是红色
        System.out.println("\033[32m"+"32是绿色"+"\033[m");//中间的字符串打印出来将是绿色
        System.out.println("\033[31m"+"从这里开始-开发新的功能"+"\033[m");//中间的字符串打印出来将是红色
        System.out.println("\033[32m"+"从这里开始-开发新的功能"+"\033[m");//中间的字符串打印出来将是绿色
        System.out.println("\033[33m"+"从这里开始-开发新的功能"+"\033[m");//中间的字符串打印出来将是红色
        System.out.println("\033[34m"+"从这里开始-开发新的功能"+"\033[m");//中间的字符串打印出来将是绿色
        System.out.println("\033[35m"+"从这里开始-开发新的功能"+"\033[m");//中间的字符串打印出来将是红色
        System.out.println("\033[36m"+"从这里开始-开发新的功能"+"\033[m");//中间的字符串打印出来将是绿色
        //输出绿底行
        System.out.print("\33[42;1m"+"文字"+"\n\33[0m");
        System.out.print("\33[43;1m"+"文字"+"\n\33[0m");
        System.out.print("\33[44;1m"+"文字"+"\n\33[0m");
        System.out.print("\33[45;1m"+"文字"+"\n\33[0m");
        System.out.print("\33[46;1m"+"文字"+"\n\33[0m");
        System.out.print("\33[47;1m"+"文字"+"\n\33[0m");
        // 红色文本
        log.info("\u001B[31m  This is red text.\u001B[0m");
        // 绿色文本
        log.info("\u001B[32m  This is green text.\u001B[0m");
        // 蓝色文本
        log.info("\u001B[34m  This is blue text.\u001B[0m");

        // 红色底部
        log.info("\u001B[41m  This is red bottom text.\u001B[0m");
        // 绿色底部
        log.info("\u001B[42m  This is green bottom text.\u001B[0m");
        // 蓝色底部
        log.info("\u001B[44m  This is blue bottom text.\u001B[0m");
        return Result.build(null, ResultCodeEnum.SUCCESS);
    }

    @GetMapping("/test004")
    public Result test004() {

        log.info("\u001B[" + 40 + "m This is text with background color code " + 40 + ".\u001B[0m");
        log.info("\u001B[" + 41 + "m This is text with background color code " + 41 + ".\u001B[0m");
        log.info("\u001B[" + 42 + "m This is text with background color code " + 42 + ".\u001B[0m");
        log.info("\u001B[" + 43 + "m This is text with background color code " + 43 + ".\u001B[0m");
        log.info("\u001B[" + 44 + "m This is text with background color code " + 44 + ".\u001B[0m");
        log.info("\u001B[" + 45 + "m This is text with background color code " + 45 + ".\u001B[0m");
        log.info("\u001B[" + 46 + "m This is text with background color code " + 46 + ".\u001B[0m");
        log.info("\u001B[" + 47 + "m This is text with background color code " + 47 + ".\u001B[0m");
        System.out.println("--------------------------分割线-------------------");
        for (int i = 30; i <= 37; i++) {
            log.info("\u001B[" + i + "m This is text with color code " + i + ".\u001B[0m");
        }

        for (int i = 90; i <= 97; i++) {
            log.info("\u001B[" + i + "m This is text with bright color code " + i + ".\u001B[0m");
        }

        for (int i = 40; i <= 47; i++) {
            log.info("\u001B[" + i + "m This is text with background color code " + i + ".\u001B[0m");
        }

        for (int i = 100; i <= 107; i++) {
            log.info("\u001B[" + i + "m This is text with bright background color code " + i + ".\u001B[0m");
        }
        return Result.build("success", ResultCodeEnum.SUCCESS);
    }

    @GetMapping("/test005")
    public Result test005() {
        log.info("\u001B[" + 40 + "m This is text with background color code " + 40 + ".\u001B[0m");
        log.info("\u001B[" + 41 + "m This is text with background color code " + 41 + ".\u001B[0m");
        log.info("\u001B[" + 42 + "m This is text with background color code " + 42 + ".\u001B[0m");
        log.info("\u001B[" + 43 + "m This is text with background color code " + 43 + ".\u001B[0m");
        log.info("\u001B[" + 44 + "m This is text with background color code " + 44 + ".\u001B[0m");
        log.info("\u001B[" + 45 + "m This is text with background color code " + 45 + ".\u001B[0m");
        log.info("\u001B[" + 46 + "m This is text with background color code " + 46 + ".\u001B[0m");
        log.info("\u001B[" + 47 + "m This is text with background color code " + 47 + ".\u001B[0m");
        System.out.println("--------------------------分割线-------------------");

        System.out.println("--------------------------分割线-------------------");
        System.out.print("\33[42;1m"+"This is text with background color code"+"\n\33[0m");
        System.out.print("\33[43;1m"+"This is text with background color code"+"\n\33[0m");
        System.out.print("\33[44;1m"+"This is text with background color code"+"\n\33[0m");
        System.out.print("\33[45;1m"+"This is text with background color code"+"\n\33[0m");
        System.out.print("\33[46;1m"+"This is text with background color code"+"\n\33[0m");
        System.out.print("\33[47;1m"+"This is text with background color code"+"\n\33[0m");

        return Result.build("success", ResultCodeEnum.SUCCESS);
    }
}
